package cn.echo.consul.manager.response;

import java.io.Serializable;


/**
 * 返回消息伪枚举 - 使用时可以直接继承扩展
 *
 * @author lonyee
 */
public class ResultCode implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 参数错误（Incorrect Argument）
     */
    public static final ResultCode F11201 = new ResultCode(11201, "参数错误，%s");
    /**
     * 编号已经存在（Incorrect Argument）
     */
    public static final ResultCode F11202 = new ResultCode(11202, "编号已经存在");
    /**
     * 获取锁超时（lock timeout）
     */
    public static final ResultCode F11203 = new ResultCode(11202, "获取锁超时");
    /**
     * 操作失败（Normal Error）
     */
    public static final ResultCode F11400 = new ResultCode(11400, "操作失败，%s");
    /**
     * 未授权（Unauthorized）
     */
    public static final ResultCode F11401 = new ResultCode(11401, "登录超时，请重新授权登录");
    /**
     * 无权限（Forbidden）
     */
    public static final ResultCode F11403 = new ResultCode(11403, "暂无访问权限，请联系管理员处理");
    /**
     * [服务器]运行时异常（Runtime Error）
     */
    public static final ResultCode F11405 = new ResultCode(11405, "运行时异常，%s");
    /**
     * [服务器]空值异常（NullPointer Error）
     */
    public static final ResultCode F11406 = new ResultCode(11406, "空值异常，%s");
    /**
     * [服务器]IO异常（IO Error）
     */
    public static final ResultCode F11407 = new ResultCode(11407, "IO异常，%s");
    /**
     * [服务器]数组越界异常（Array index out of bounds Error）
     */
    public static final ResultCode F11408 = new ResultCode(11408, "数组越界异常，%s");
    /**
     * 网络异常（Socket Error）
     */
    public static final ResultCode F11409 = new ResultCode(11409, "网络异常，请稍后重试");
    /**
     * 请求太频繁（Too Many Requests）
     */
    public static final ResultCode F11429 = new ResultCode(11429, "请求太频繁，请稍后重试");

    /**
     * 请输入密码
     */
    public static final ResultCode F11606 = new ResultCode(11606, "密码格式错误");
    /**
     * 请输入账号
     */
    public static final ResultCode F11607 = new ResultCode(11607, "账号格式错误");
    /**
     * 请输入用户名
     */
    public static final ResultCode F11608 = new ResultCode(11608, "用户名格式错误");
    /**
     * 帐号不存在
     */
    public static final ResultCode F11610 = new ResultCode(11610, "帐号不存在");
    /**
     * 帐号已冻结
     */
    public static final ResultCode F11611 = new ResultCode(11611, "帐号已限制登录");
    /**
     * 帐号或密码错误
     */
    public static final ResultCode F11612 = new ResultCode(11612, "帐号或密码错误");
    /**
     * 帐号已存在
     */
    public static final ResultCode F11613 = new ResultCode(11613, "帐号已存在");

    /**
     * 登录密码错误(修改密码时)
     */
    public static final ResultCode F11618 = new ResultCode(11618, "登录密码错误");
    /**
     * 两次输入的密码不一致(修改密码时)
     */
    public static final ResultCode F11619 = new ResultCode(11619, "两次输入的密码不一致");


    /**
     * 不允许给自己授权
     */
    public static final ResultCode F11621 = new ResultCode(11621, "不允许给自己授权");
    /**
     * 项目编号格式错误
     */
    public static final ResultCode F11622 = new ResultCode(11622, "项目编号格式错误");
    /**
     * 项目不存在
     */
    public static final ResultCode F11623 = new ResultCode(11623, "项目不存在");
    /**
     * 项目已存在
     */
    public static final ResultCode F11624 = new ResultCode(11624, "项目已存在");
    /**
     * Key键不能为空
     */
    public static final ResultCode F11625 = new ResultCode(11625, "Key键不能为空");
    /**
     * Value值不能为空
     */
    public static final ResultCode F11626 = new ResultCode(11626, "Value值不能为空");
    /**
     * YAML键值不能为空
     */
    public static final ResultCode F11627 = new ResultCode(11627, "YAML键值不能为空");
    /**
     * YAML键值格式错误
     */
    public static final ResultCode F11628 = new ResultCode(11628, "YAML键值格式错误，请检查后重试");



    private int code;
    private String msg;

    public ResultCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

}
